package cn.shopping.core.mapper;

import cn.shopping.common.mapper.CommonMapper;
import cn.shopping.core.dbo.UploadInfoImgDO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.util.CollectionUtils;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;



/**
 * 代码自动生成，请不要修改，切记！！！
 */
@Mapper
public interface UploadInfoImgMapper extends CommonMapper<UploadInfoImgDO,Long> {

        public List<UploadInfoImgDO> listByUploadId(@Param("uploadId") Long uploadId,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByUploadId(@Param("uploadId") Long uploadId,@Param("fieldNames") String[] fieldNames);

        public Integer countByUploadId(@Param("uploadId") Long uploadId);

        public default UploadInfoImgDO singleResultByUploadId(Long uploadId,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByUploadId(uploadId,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByUploadId(Long uploadId, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByUploadId(uploadId,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByUploadId(@Param("updateDO") UploadInfoImgDO updateDO, @Param("uploadId") Long uploadId);

        public Integer updateAllFieldsByUploadId(@Param("updateDO") UploadInfoImgDO updateDO, @Param("uploadId") Long uploadId);

        public Integer deleteByUploadId( @Param("uploadId") Long uploadId);




        public List<UploadInfoImgDO> listByInUploadId(@Param("uploadIdList") Collection<Long> uploadIdList,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByInUploadId(@Param("uploadIdList") Collection<Long> uploadIdList,@Param("fieldNames") String[] fieldNames);

        public Integer countByInUploadId(@Param("uploadIdList") Collection<Long> uploadIdList);

        public default UploadInfoImgDO singleResultByInUploadId(Collection<Long> uploadIdList,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInUploadId(uploadIdList,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByInUploadId(Collection<Long> uploadIdList, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInUploadId(uploadIdList,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByInUploadId(@Param("updateDO") UploadInfoImgDO updateDO, @Param("uploadIdList") Collection<Long> uploadIdList);

        public Integer updateAllFieldsByInUploadId(@Param("updateDO") UploadInfoImgDO updateDO, @Param("uploadIdList") Collection<Long> uploadIdList);

        public Integer deleteByInUploadId( @Param("uploadIdList") Collection<Long> uploadIdList);

        public List<UploadInfoImgDO> listByFilePath(@Param("filePath") String filePath,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByFilePath(@Param("filePath") String filePath,@Param("fieldNames") String[] fieldNames);

        public Integer countByFilePath(@Param("filePath") String filePath);

        public default UploadInfoImgDO singleResultByFilePath(String filePath,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByFilePath(filePath,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByFilePath(String filePath, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByFilePath(filePath,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByFilePath(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePath") String filePath);

        public Integer updateAllFieldsByFilePath(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePath") String filePath);

        public Integer deleteByFilePath( @Param("filePath") String filePath);




        public List<UploadInfoImgDO> listByInFilePath(@Param("filePathList") Collection<String> filePathList,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByInFilePath(@Param("filePathList") Collection<String> filePathList,@Param("fieldNames") String[] fieldNames);

        public Integer countByInFilePath(@Param("filePathList") Collection<String> filePathList);

        public default UploadInfoImgDO singleResultByInFilePath(Collection<String> filePathList,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInFilePath(filePathList,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByInFilePath(Collection<String> filePathList, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInFilePath(filePathList,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByInFilePath(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePathList") Collection<String> filePathList);

        public Integer updateAllFieldsByInFilePath(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePathList") Collection<String> filePathList);

        public Integer deleteByInFilePath( @Param("filePathList") Collection<String> filePathList);

        public List<UploadInfoImgDO> listByFileSize(@Param("fileSize") Long fileSize,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByFileSize(@Param("fileSize") Long fileSize,@Param("fieldNames") String[] fieldNames);

        public Integer countByFileSize(@Param("fileSize") Long fileSize);

        public default UploadInfoImgDO singleResultByFileSize(Long fileSize,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByFileSize(fileSize,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByFileSize(Long fileSize, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByFileSize(fileSize,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByFileSize(@Param("updateDO") UploadInfoImgDO updateDO, @Param("fileSize") Long fileSize);

        public Integer updateAllFieldsByFileSize(@Param("updateDO") UploadInfoImgDO updateDO, @Param("fileSize") Long fileSize);

        public Integer deleteByFileSize( @Param("fileSize") Long fileSize);




        public List<UploadInfoImgDO> listByInFileSize(@Param("fileSizeList") Collection<Long> fileSizeList,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByInFileSize(@Param("fileSizeList") Collection<Long> fileSizeList,@Param("fieldNames") String[] fieldNames);

        public Integer countByInFileSize(@Param("fileSizeList") Collection<Long> fileSizeList);

        public default UploadInfoImgDO singleResultByInFileSize(Collection<Long> fileSizeList,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInFileSize(fileSizeList,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByInFileSize(Collection<Long> fileSizeList, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInFileSize(fileSizeList,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByInFileSize(@Param("updateDO") UploadInfoImgDO updateDO, @Param("fileSizeList") Collection<Long> fileSizeList);

        public Integer updateAllFieldsByInFileSize(@Param("updateDO") UploadInfoImgDO updateDO, @Param("fileSizeList") Collection<Long> fileSizeList);

        public Integer deleteByInFileSize( @Param("fileSizeList") Collection<Long> fileSizeList);

        public List<UploadInfoImgDO> listByFilePixel(@Param("filePixel") Integer filePixel,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByFilePixel(@Param("filePixel") Integer filePixel,@Param("fieldNames") String[] fieldNames);

        public Integer countByFilePixel(@Param("filePixel") Integer filePixel);

        public default UploadInfoImgDO singleResultByFilePixel(Integer filePixel,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByFilePixel(filePixel,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByFilePixel(Integer filePixel, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByFilePixel(filePixel,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByFilePixel(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePixel") Integer filePixel);

        public Integer updateAllFieldsByFilePixel(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePixel") Integer filePixel);

        public Integer deleteByFilePixel( @Param("filePixel") Integer filePixel);




        public List<UploadInfoImgDO> listByInFilePixel(@Param("filePixelList") Collection<Integer> filePixelList,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByInFilePixel(@Param("filePixelList") Collection<Integer> filePixelList,@Param("fieldNames") String[] fieldNames);

        public Integer countByInFilePixel(@Param("filePixelList") Collection<Integer> filePixelList);

        public default UploadInfoImgDO singleResultByInFilePixel(Collection<Integer> filePixelList,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInFilePixel(filePixelList,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByInFilePixel(Collection<Integer> filePixelList, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInFilePixel(filePixelList,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByInFilePixel(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePixelList") Collection<Integer> filePixelList);

        public Integer updateAllFieldsByInFilePixel(@Param("updateDO") UploadInfoImgDO updateDO, @Param("filePixelList") Collection<Integer> filePixelList);

        public Integer deleteByInFilePixel( @Param("filePixelList") Collection<Integer> filePixelList);

        public List<UploadInfoImgDO> listByUserIdCreate(@Param("userIdCreate") Long userIdCreate,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByUserIdCreate(@Param("userIdCreate") Long userIdCreate,@Param("fieldNames") String[] fieldNames);

        public Integer countByUserIdCreate(@Param("userIdCreate") Long userIdCreate);

        public default UploadInfoImgDO singleResultByUserIdCreate(Long userIdCreate,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByUserIdCreate(userIdCreate,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByUserIdCreate(Long userIdCreate, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByUserIdCreate(userIdCreate,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByUserIdCreate(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdCreate") Long userIdCreate);

        public Integer updateAllFieldsByUserIdCreate(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdCreate") Long userIdCreate);

        public Integer deleteByUserIdCreate( @Param("userIdCreate") Long userIdCreate);




        public List<UploadInfoImgDO> listByInUserIdCreate(@Param("userIdCreateList") Collection<Long> userIdCreateList,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByInUserIdCreate(@Param("userIdCreateList") Collection<Long> userIdCreateList,@Param("fieldNames") String[] fieldNames);

        public Integer countByInUserIdCreate(@Param("userIdCreateList") Collection<Long> userIdCreateList);

        public default UploadInfoImgDO singleResultByInUserIdCreate(Collection<Long> userIdCreateList,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInUserIdCreate(userIdCreateList,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByInUserIdCreate(Collection<Long> userIdCreateList, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInUserIdCreate(userIdCreateList,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByInUserIdCreate(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdCreateList") Collection<Long> userIdCreateList);

        public Integer updateAllFieldsByInUserIdCreate(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdCreateList") Collection<Long> userIdCreateList);

        public Integer deleteByInUserIdCreate( @Param("userIdCreateList") Collection<Long> userIdCreateList);

        public List<UploadInfoImgDO> listByUserIdModified(@Param("userIdModified") Long userIdModified,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByUserIdModified(@Param("userIdModified") Long userIdModified,@Param("fieldNames") String[] fieldNames);

        public Integer countByUserIdModified(@Param("userIdModified") Long userIdModified);

        public default UploadInfoImgDO singleResultByUserIdModified(Long userIdModified,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByUserIdModified(userIdModified,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByUserIdModified(Long userIdModified, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByUserIdModified(userIdModified,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByUserIdModified(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdModified") Long userIdModified);

        public Integer updateAllFieldsByUserIdModified(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdModified") Long userIdModified);

        public Integer deleteByUserIdModified( @Param("userIdModified") Long userIdModified);




        public List<UploadInfoImgDO> listByInUserIdModified(@Param("userIdModifiedList") Collection<Long> userIdModifiedList,@Param("fieldNames") String[] fieldNames);

        @MapKey("id")
        public Map<Long,UploadInfoImgDO> mapByInUserIdModified(@Param("userIdModifiedList") Collection<Long> userIdModifiedList,@Param("fieldNames") String[] fieldNames);

        public Integer countByInUserIdModified(@Param("userIdModifiedList") Collection<Long> userIdModifiedList);

        public default UploadInfoImgDO singleResultByInUserIdModified(Collection<Long> userIdModifiedList,String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInUserIdModified(userIdModifiedList,fieldNames);
             return CollectionUtils.isEmpty(list)?null:list.get(0);
        }

         public default <T> Map<T,List<UploadInfoImgDO>> groupingByInUserIdModified(Collection<Long> userIdModifiedList, Function<UploadInfoImgDO, T> mapper, String[] fieldNames){
             List<UploadInfoImgDO> list=this.listByInUserIdModified(userIdModifiedList,fieldNames);
             if(CollectionUtils.isEmpty(list)){
                return new HashMap<>();
             }
             return list.stream().collect(Collectors.groupingBy(mapper));
         }

        public Integer updateNotNullFieldsByInUserIdModified(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdModifiedList") Collection<Long> userIdModifiedList);

        public Integer updateAllFieldsByInUserIdModified(@Param("updateDO") UploadInfoImgDO updateDO, @Param("userIdModifiedList") Collection<Long> userIdModifiedList);

        public Integer deleteByInUserIdModified( @Param("userIdModifiedList") Collection<Long> userIdModifiedList);


}
